define(['./../../initial', './../../service/loadPublicMap'], function () {
    var app = angular.module('App');
    app.controller('mapCtrl', ['$scope', 'Project', 'viewbag', 'loadPublicMap', function ($scope, Project, viewbag, loadPublicMap) {
        //默认加载第一个城市的所有项目
        loadPublicMap(viewbag.curCity);
        setTimeout(function () {
            $('#map-type-btn').popup({
                on: 'click',
                position: 'bottom right'
            });
        }, 200);
        $scope.$on('curCityChange', function (event, data) {
            loadPublicMap(viewbag.curCity);
        });
    }]);
});